<?php
/**
 * Here is your custom functions.
 */

/**
 * 记录seaslog
 * @param string $model
 * @param string $url
 * @param array $req
 * @param array $res
 * @param int $costTime
 */
function saveLog(string $model, string $url,array $req,array $res,float $costTime): void
{
    \SeasLog::setBasePath(config('log.log_path'));
    $resultDataString = json_encode($res, JSON_UNESCAPED_UNICODE);
    $postDataString = json_encode($req, JSON_UNESCAPED_UNICODE);
    $message = 'url:'.$url.';cost_time:'.$costTime.'s;req:'.$postDataString.';res:'.$resultDataString;
    \SeasLog::info($message,[], $model);
}